//
//  UserProfileInfos.swift
//  MT
//
//  Created by M on 2019/12/29.
//  Copyright © 2019 张强. All rights reserved.
//

import Foundation
import UIKit
import MTCategory

// MARK: ------------------ 验证类型 ----------------------
@objc
enum UserProfileInfos: Int {
    
    /// 头像
    case portrait = 0
    /// 昵称
    case nickname
    /// 性别
    case gender
    /// 生日
    case birthday
    /// 位置
    case location
    /// 图册（修改个人资料页面需要）
    case gallery
    /// 个人签名（修改个人资料页面需要）
    case signature
    
    /// 身高
    case body_height
    /// 体重
    case body_weight
    /// 星座
    case constellation
    /// 行业
    case occupation
    /// 职位
    case occupation_position
    /// 学校
    case school
    /// 学位
    case degree
    /// 我的标签
    case tags
    /// 我的兴趣
    case hobbies
    /// 自拍视频
    case video
    ///人脸认证
    case authVideo
    ///真实姓名
    case realName
    ///身份证号
    case idNumber
    ///身份证照片
    case idNumberImg
    ///支付宝账号
    case aliPayAccount
    ///银行卡号
    case bankAccount
    ///开户行
    case bankName
    ///营业执照
    case license
    ///联系人
    case contactName
    ///联系手机
    case contactPhone
    ///抖音截图
    case TiktokShot
    ///快手截图
    case KuaishouShot
    ///小红书截图
    case RedShot
    ///其他平台截图
    case OtherShot
    
    /// 输入类型
    @objc enum InputType: Int {
        case keyboard, picker, tag, none
    }
    var inputType: InputType {
        switch self {
        case .portrait, .gender, .gallery,.video,.authVideo,.idNumberImg,.license,.TiktokShot,.KuaishouShot,.RedShot,.OtherShot:
            return .none
        case .nickname, .signature, .occupation, .school,.realName,.idNumber,.aliPayAccount,.bankName,.bankAccount,.contactName,.contactPhone:
            return .keyboard
        case .birthday, .location, .body_height, .body_weight, .constellation, .degree,.occupation_position:
            return .picker
        case .tags, .hobbies:
            return .tag
        }
    }
    
    /// 最大字数
    var maximumTextCount: Int? {
        switch self {
        case .nickname:
            return 20
        case .signature:
            return 15
        default:
            return nil
        }
    }
    
    /// 是否可被编辑
    var editable: Bool {
        switch self {
        case .gender, .portrait, .gallery, .tags, .hobbies,.video,.authVideo,.idNumberImg,.license,.TiktokShot,.KuaishouShot,.RedShot,.OtherShot:
            return false
        default:
            return true
        }
    }
    
    /// 标题
    var title: String? {
        switch self {
        case .portrait:                 return "请上传头像"
        case .nickname:                 return "昵称"
        case .gender:                   return "性别"
        case .birthday:                 return "生日"
        case .location:                 return "城市"
        case .signature:                return "个性签名"
        case .body_height:              return "身高"
        case .body_weight:              return "体重"
        case .constellation:            return "星座"
        case .occupation:               return "行业"
        case .occupation_position:      return "职位"
        case .school:                   return "学校"
        case .degree:                   return "学历"
        case .tags:                     return "标签"
        case .hobbies:                  return "兴趣"
        case .video:                    return "上传视频"
        case .authVideo:                return "人脸认证"
        case .realName:                 return "真实姓名"
        case .idNumber:                 return "身份证号码"
        case .idNumberImg:              return "身份证验证"
        case .aliPayAccount:            return "支付宝账号"
        case .bankAccount:              return "银行卡号"
        case .bankName:                 return "开户行"
        case .license:                  return "请上传营业执照"
        case .contactName:              return "联系人"
        case .contactPhone:             return "手机号码"
        case .TiktokShot:               return "请上传“抖音”个人主页截图"
        case .KuaishouShot:             return "请上传“快手”个人主页截图"
        case .RedShot:                  return "请上传“小红书”个人主页截图"
        case .OtherShot:                return "请上传其他平台个人主页截图"
        default:
            return nil
        }
    }
    
    /// 占位文字
    var placeholder: NSAttributedString? {
        var string: String
        switch self {
        case .nickname:                                             string = "请输入内容"
        case .gender:                                               string = "性别选择后就不能更改了哦"
        case .birthday:                                             string = "请选择"
        case .location:                                             string = "请选择您的城市"
        case .signature:                                            string = "请输入内容"
        case .video:                                                string = "上传您最满意的自拍视频"
        case .authVideo:                                            string = "觅颜是一个100%全真人的社交平台\n所有人都需要经过视频视镜"
        case .occupation, .occupation_position, .school:            string = "请选择"
        case .body_height, .body_weight, .constellation, .degree:   string = "请选择"
        case .realName, .idNumber,.aliPayAccount,.bankAccount,.bankName:                                  string = "请输入"
        case .tags:                                                 string = "添加个人标签"
        case .hobbies:                                              string = "添加兴趣爱好"
        case .contactName:                                          string = "请输入联系人姓名"
        case .contactPhone:                                         string = "请输入手机号码"
        default:
            return nil
        }
        let a_s = NSMutableAttributedString(string: string)
        a_s.addAttributes([.foregroundColor: UIColor(hex: 0x5d5d5d),
                           .font: PingFangSCRegularFont(12)], range: NSMakeRange(0, a_s.length))
        return a_s
    }
    
    /// 注册类型
    var cellClass: AnyClass? {
        switch self {
        case .nickname, .signature, .occupation, .school,.realName,.idNumber,.aliPayAccount,.bankAccount,.bankName,.contactName,.contactPhone:
            return MTInfoVerificationInputCell.self
        case .birthday, .location, .body_height, .body_weight, .constellation , .degree,.occupation_position:
            return MTInfoVerificationPickerCell.self
        case .portrait,.license,.TiktokShot,.KuaishouShot,.RedShot,.OtherShot:
            return MTInfoVerificationPortraitCell.self
        case .gender:
            return MTInfoVerificationGenderCell.self
        case .gallery:
            return MineGalleryTableViewCell.self
        case .tags, .hobbies:
            return MineTagsTableViewCell.self
        case .video:
            return MTInfoUploadVideoCell.self
        case .authVideo:
            return MTInfoUploadAuthVideoCell .self
        case .idNumberImg:
            return MTCertificationUploadCell.self
        }
    }
    
    /// Cell 高度
    var cellHeight: CGFloat {
        switch self {
        case .nickname, .birthday, .location, .signature, .body_height, .body_weight,
             .constellation, .occupation, .occupation_position, .school, .degree,.realName,.idNumber,.aliPayAccount,.bankAccount,.bankName,.contactName,.contactPhone:
            return 50.0
        case .portrait,.license,.TiktokShot,.KuaishouShot,.RedShot,.OtherShot:
            return 80.0
        case .gender:
            return 80.0
        case .gallery:
            return 80
        case .tags, .hobbies:
            return 50
        case .video:
            return 146
        case .idNumberImg:
            return 330
        case .authVideo:
            return 340
        }
    }
    
    /// 本地 plist 文件名
    var pickerPlistName: String? {
        switch self {
        case .location:
            return Bundle.main.path(forResource: "ProvincesAndCities", ofType: "plist")
        default:
            return nil
        }
    }
    
    /// 选择器数据源
    var pickerSources: [String]? {
        switch self {
        case .body_height:
            return ["150cm", "151cm", "152cm", "153cm", "154cm", "155cm", "156cm", "157cm", "158cm", "159cm",
                    "160cm", "161cm", "162cm", "163cm", "164cm", "165cm", "166cm", "167cm", "168cm", "169cm",
                    "170cm", "171cm", "172cm", "173cm", "174cm", "175cm", "176cm", "177cm", "178cm", "179cm",
                    "180cm", "181cm", "182cm", "183cm", "184cm", "185cm", "186cm", "187cm", "188cm", "189cm",
                    "190cm", "191cm", "192cm", "193cm", "194cm", "195cm", "196cm", "197cm", "198cm", "199cm",
                    "200cm", "201cm", "202cm", "203cm", "204cm", "205cm", "206cm", "207cm", "208cm", "209cm", "210cm"]
            
        case .body_weight:
            return ["40kg", "41kg", "42kg", "43kg", "44kg", "45kg", "46kg", "47kg", "48kg", "49kg",
                    "50kg", "51kg", "52kg", "53kg", "54kg", "55kg", "56kg", "57kg", "58kg", "59kg",
                    "60kg", "61kg", "62kg", "63kg", "64kg", "65kg", "66kg", "67kg", "68kg", "69kg",
                    "70kg", "71kg", "72kg", "73kg", "74kg", "75kg", "76kg", "77kg", "78kg", "79kg",
                    "80kg", "81kg", "82kg", "83kg", "84kg", "85kg", "86kg", "87kg", "88kg", "89kg",
                    "90kg", "91kg", "92kg", "93kg", "94kg", "95kg", "96kg", "97kg", "98kg", "99kg", "100kg"]
            
        case .constellation:
            return ["摩羯座", "水瓶座", "双鱼座", "白羊座", "金牛座", "双子座", "巨蟹座", "狮子座", "处女座", "天秤座", "天蝎座", "射手座"]
            
        case .degree:
            return ["初中", "高中", "大专", "本科", "研究生", "博士"]
        case .occupation_position:
            return ["自由职业者","小小博主一名","店主","普通上班族","企业经营者","企业高管"]
            
        default:
            return nil
        }
    }
    
}
